package tests;

import java.util.HashMap;
import java.util.Map;

import UrlValidator.UrlValidator;

public class Main {

	public static void main(String[] args) 
	{
		System.out.println("Starting tests(main):");
		
		manualTests();
		//partitionOneTest();
		//partitionTwoTest();
		//partitionThreeTest();
		//unitTest();
		
		System.out.println("Finished with all tests");
	}

	private static void manualTests() 
	{
		System.out.println("Starting Manual Tests: ");
		
		UrlValidator urlValidator = new UrlValidator(null, null, UrlValidator.ALLOW_ALL_SCHEMES);
		Map<String, Boolean> testUrls = new HashMap<String, Boolean>();
		
		
		testUrls.put("http://www.amazon.com/!", true);
		testUrls.put("http://www.amazon.com/@", true);
		testUrls.put("http://www.amazon.com/run%40space", true);
		testUrls.put("http://www.amazon.com/$", true);
		testUrls.put("http://www.amazon.com/%", true);
		testUrls.put("http://www.amazon.com/^", true);
		testUrls.put("http://www.amazon.com/&", true);
		testUrls.put("http://www.amazon.com/*", true);
		testUrls.put("http://www.amazon.com/(", true);
		testUrls.put("http://www.amazon.com/)", true);
		for (Map.Entry<String, Boolean> entry : testUrls.entrySet())
		{
			boolean result = urlValidator.isValid(entry.getKey());
			
			if (result != entry.getValue())
			{
				System.out.format("Expected: %-5b | Actual: %-5b | Url: %s\n", entry.getValue(), result, entry.getKey());
			}
		}
	}
	
	private static void partitionOneTest()
	{
		
	}
	
	private static void partitionTwoTest()
	{
		
	}
	
	private static void partitionThreeTest()
	{
		
	}
	
	private static void unitTest()
	{
		
	}

}
